package com.xzqwjw.taskmanager.activity;

import com.xzqwjw.taskmanager.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class ActivitySetting extends Activity implements OnClickListener {

  private String strDBFile = "";

  private ImageButton imgbtnResetPwd;
  private ImageButton imgbtnSetPhoto;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_setting);

    Intent objIT = getIntent();
    strDBFile = objIT.getStringExtra("DBFilePath");

    initView();
    initClickEvent();
  }

  private void initView() {
    imgbtnResetPwd = (ImageButton) findViewById(R.id.imgbtn_resetpassword);
    imgbtnSetPhoto = (ImageButton) findViewById(R.id.imgbtn_setphoto);
  }

  private void initClickEvent() {
    imgbtnResetPwd.setOnClickListener(this);
    imgbtnSetPhoto.setOnClickListener(this);
  }

  @Override
  public void onClick(View v) {
    Intent objIT;
    int id = v.getId();
    if (id == R.id.imgbtn_resetpassword) {
      objIT = new Intent(ActivitySetting.this,
          ActivityResetPassword.class);
      objIT.putExtra("DBFilePath", strDBFile);
      startActivity(objIT);
    } else if (id == R.id.imgbtn_setphoto) {
      objIT = new Intent(ActivitySetting.this, ActivitySetPhoto.class);
      objIT.putExtra("DBFilePath", strDBFile);
      startActivity(objIT);
    } else if (id == R.id.imgbtn_quit) {
    } else {
    }
  }
}
